//用法求 //求Ax+By==K
#include<bits/stdc++.h>
using namespace std;

int exgcd(int a, int b, int& x, int& y)
{
	if (!b)
	{
		x = 1; y = 0;
		return a;
	}
	int d = exgcd(b, a % b, y, x);
	y -= (a / b) * x;
	return d;
}

int main()
{
	int a, b, k, x = 0, y = 0;
	cin >> a >> b >> k;
	int d = exgcd(a, b, x, y);
	cout << "gcd(a,b): " << x << " " << y << '\n';
	if (k % d) { puts("no solution!"); return 0; }//gcd一定是k的倍数 
	else
	{
		x = x * (k / d);
		y = (k - a * x) / b;
	}
	cout << "gcd(a,b) " << d << '\n';
	cout << "answer: " << x << " " << y << '\n';

	return 0;
}